<template>
  <div class="app-front-container">
    <!-- 导航栏 -->
    <HeaderBar />

    <!-- 内容区域 -->
    <div class="front-content">
      <router-view v-slot="{ Component }">
        <transition name="fade" mode="out-in">
          <component :is="Component" />
        </transition>
      </router-view>
    </div>

    <!-- 页脚 -->
    <div class="front-footer">
      <div class="footer-container">
        <div class="footer-content">
          <div class="footer-section">
            <h3>关于我们</h3>
            <p>
              宠物领养平台致力于为流浪动物提供一个温暖的家，为爱宠人士和待领养宠物搭建桥梁。
            </p>
          </div>
          <div class="footer-section">
            <h3>联系方式</h3>
            <p>电话: 400-123-4567</p>
            <p>邮箱: contact@pet-adoption.com</p>
            <p>地址: 北京市朝阳区xxx街道xxx号</p>
          </div>
          <div class="footer-section">
            <h3>快速链接</h3>
            <ul>
              <li><router-link to="/">首页</router-link></li>
              <li><router-link to="/pet/list">宠物列表</router-link></li>
              <li><router-link to="/pet/adoption">待领养</router-link></li>
              <li><router-link to="/about">关于我们</router-link></li>
            </ul>
          </div>
        </div>
        <div class="footer-bottom">
          <p>&copy; {{ new Date().getFullYear() }} 宠物领养平台 版权所有</p>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
import { useRouter, useRoute } from "vue-router";
import HeaderBar from "@/components/HeaderBar.vue";

const router = useRouter();
const route = useRoute();
</script>

<style scoped>
.app-front-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* 内容区域样式 */
.front-content {
  flex: 1;
  padding: 20px 0;
  background-color: #f5f7fa;
}

/* 页脚样式 */
.front-footer {
  background-color: #303133;
  color: #fff;
  padding: 40px 0 20px;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.footer-content {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  margin-bottom: 30px;
}

.footer-section {
  flex: 1;
  min-width: 200px;
  margin-bottom: 20px;
  padding-right: 20px;
}

.footer-section h3 {
  font-size: 18px;
  margin-bottom: 15px;
  position: relative;
  padding-bottom: 10px;
}

.footer-section h3::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 30px;
  height: 2px;
  background-color: #409eff;
}

.footer-section p {
  margin-bottom: 10px;
  color: #a6a6a6;
  line-height: 1.6;
}

.footer-section ul {
  padding: 0;
  list-style: none;
}

.footer-section ul li {
  margin-bottom: 8px;
}

.footer-section ul li a {
  color: #a6a6a6;
  text-decoration: none;
  transition: color 0.3s;
}

.footer-section ul li a:hover {
  color: #409eff;
}

.footer-bottom {
  border-top: 1px solid #484848;
  padding-top: 20px;
  text-align: center;
}

.footer-bottom p {
  color: #a6a6a6;
  font-size: 14px;
}

/* 路由过渡动画 */
.fade-enter-active,
.fade-leave-active {
  transition: opacity 0.3s;
}

.fade-enter-from,
.fade-leave-to {
  opacity: 0;
}
</style>
